package com.baor.controller;

import com.baor.service.CommentService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;

@RestController
@RequestMapping("/comments")
public class CommentController {
    @Autowired
    private CommentService commentService;
    @RequestMapping("/insertComment")
    public AjaxResult<?> insertComment(@RequestBody Map<String, Object> params){
        return this.commentService.insertComment(params);
    }
    @RequestMapping("/selectComment")
    public AjaxResult<?> selectComment(@RequestBody Map<String, Object> params){
        return this.commentService.selectComment(params);
    }
    @RequestMapping("/deleteComment")
    public AjaxResult<?> deleteComment(@RequestBody Map<String, Object> params){
        return this.commentService.deleteComment(params);
    }

    @RequestMapping("/updateCommentStatus")
    public AjaxResult<?> updateCommentStatus(@RequestBody Map<String, Object> params){
        return this.commentService.updateCommentStatus(params);
    }
    @RequestMapping("/selectCommentLevel")
    public AjaxResult<?> selectCommentLevel(){
        return this.commentService.selectCommentLevel();
    }
    @RequestMapping("/replyComment")
    public AjaxResult<?> replyComment(@RequestBody Map<String, Object> params){
        return this.commentService.replyComment(params);
    }
    @RequestMapping("/selectGoods")
    public AjaxResult<?> selectGoods() {
        return this.commentService.selectGoods();
    }
    @RequestMapping("/updateCommentOrder")
    public AjaxResult<?> updateCommentOrder(@RequestBody Map<String, Object> params){
        return this.commentService.updateCommentOrder(params);
    }

    @RequestMapping("/cancelCommentOrder")
    public AjaxResult<?> cancelCommentOrder(@RequestBody Map<String, Object> params) {
        return this.commentService.cancelCommentOrder(params);
    }
}
